package com.thb.pay.api.merchant;


import com.thb.pay.api.merchant.fallback.MchQrCodeServiceApiFallbackFactory;
import com.thb.pay.api.merchant.vo.req.MchQrCodePageReq;
import com.thb.pay.api.merchant.vo.req.MchQrCodeReq;
import com.thb.pay.api.merchant.vo.resp.MchQrCodeVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "pay-service", fallbackFactory = MchQrCodeServiceApiFallbackFactory.class)
@RequestMapping("/mchQrCodeServiceApi")
public interface MchQrCodeServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<MchQrCodeVo> findPage(@RequestBody MchQrCodePageReq pageReq);

    @RequestMapping(value = "/findAllList", method = RequestMethod.GET)
    List<MchQrCodeVo> findAllList();

    @RequestMapping(value = "/getById", method = RequestMethod.GET)
    MchQrCodeVo getById(@RequestParam("id") Long id);

    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody MchQrCodeReq mchQrCodeReq);

    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody MchQrCodeReq mchQrCodeReq);

    @RequestMapping(value = "/deleteBatchIds", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void deleteBatchIds(List<Long> ids);

}
